APIs for Creating Discovery
POST /api/v2/dataCollector/schedule/
Description
Create a single discovery request. Can create a network discovery, cloud discovery, and service flow discovery by specifying the trigger type in the request body.
Header Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
| Authorization | Bearer API token/key. The format is Bearer <API_key> | String | Yes | |
| orgId | The ID of the organization. The format is OrgId:OrgName | String | Yes | |
| siteId | The ID of the site. The format is SiteId:SiteName | String | Yes |
Body Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
| requestJson | Discovery details. The format is JSON | Object | Yes |
For NETWORK discovery:
- At least one of the fields
ipPool.ipRangeоripPool.fqdnAddressmust be filled. Max 1024 IPs are allowed inipPool.ipRange. - At least one of the fields
communityStringInfoоrauthListmust be filled. - The
scheduleInfo.scheduleStartTime&scheduleInfo.scheduleEndTimefields are in EPOCH timestamp format in milliseconds & UTC. - The
scheduleInfo.intervalfield is in seconds. - The
communityStringInfofield is used for SNMP service accounts.
CURL Example
The below code snippet shows an example of creating NETWORK discovery with an API call, where <NCE-IP>, <ORG-ID>, <SITE-ID>, <API-TOKEN> & <DISCOVERY-NAME> are variables.
curl --location 'https://<NCE-IP>/api/v2/dataCollector/schedule/' \
--header 'orgId: <ORG-ID>' \
--header 'siteId: <SITE-ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API-TOKEN>' \
--data '{
"ipPool": {
"ipRange": [{
"ipAddressFrom": "10.10.10.11",
"ipAddressTo": "10.10.10.12"
}
],
"maskRange": [{
"ipAddressMask": "1.1.1.1",
"mask": "23"
}
],
"fqdnAddress": [{
"ip": "10.10.10.1",
"fqdn": "fs-t2000-1.in.fixstream.com"
}, {
"ip": "10.10.10.2",
"fqdn": ""
}
],
"fqdnV6Address": [{
"ipv6": "2001:db8:3333:4444:5555:6666:7777:8888",
"fqdn": ""
}
]
},
"dsSelectedSiteId": "<SITE-ID>",
"dsSelectedOrganization": "<ORG-ID>",
"triggerType": "NETWORK_DISCOVERY",
"scheduleInfo": {
"scheduleStartTime": 1707734580000,
"scheduleEndTime": 1707947940000,
"interval": 180
},
"communityStringInfo": [{
"serviceAccount": "QA-SNMP-v1"
}
],
"authList": [{
"ssh": true,
"telnet": "",
"serviceAccount": "QA-SSH-r-FS",
"windows": "",
"api": ""
}, {
"ssh": true,
"telnet": "",
"serviceAccount": "QA-SSH-rs-RS-QA@098",
"windows": "",
"api": ""
}, {
"ssh": "",
"telnet": "",
"username": "username",
"password": "pass",
"apiType": "XEN",
"ports": [
80
],
"sshkey": "",
"windows": "",
"api": true,
"jumpServer": "",
"userProfile": "",
"jumpServeripAddress": ""
}, {
"ssh": "",
"telnet": "",
"serviceAccount": "QA-PANORAMA-fa-FA3",
"windows": "",
"api": true,
"apiType": "XEN"
}
],
"enabledPasswordList": [],
"discoveredDeviceType": "true",
"applicationProperties": {
"openstackDetails": []
},
"noUnignored": false,
"resetCredentials": false,
"ignorePing": false,
"isIgnoreDevices": false,
"requestName": "<DISCOVERY-NAME>",
"confirmCMDB": true
}'
The below code snippet shows an example of creating Service Flow discovery with an API call, where <NCE-IP>, <ORG-ID>, <SITE-ID>, <API-TOKEN>, <DEVICE-ID>, <DEVICE-IP> & <DISCOVERY-NAME> are variables.
curl --location 'https://<NCE-IP>/api/v2/dataCollector/schedule/' \
--header 'orgId: <ORG-ID>' \
--header 'siteId: <SITE-ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API-TOKEN>' \
--data '{
"ipPool": {
"fqdnAddress": [{
"deviceId": "<DEVICE-ID>",
"fqdn": "",
"ip": "<DEVICE-IP>"
}, {
"deviceId": "<DEVICE-ID>",
"fqdn": "",
"ip": "<DEVICE-IP>"
}
],
"fqdnV6Address": [],
"maskRange": [],
"ipRange": []
},
"dsSelectedSiteId": "<SITE-ID>",
"dsSelectedOrganization": "<ORG-ID>",
"scheduleInfo": {
"recurrence": "MINUTE",
"recurrenceMin": 30,
"recurrenceHour": "",
"scheduleDate": "2024-02-14",
"scheduleTime": "08:20:AM",
"scheduleEndDate": null,
"scheduleEndTime": null
},
"ignorePing": true,
"triggerType": "PCAP_COLLECTION",
"createdBy": "Admin",
"discoveredDeviceType": "true",
"requestName": "<DISCOVERY-NAME>"
}'
Response
Upon a successful request, the API returns Status code 200 with the following body:
| Name | Description | Type |
|---|---|---|
| data | Request ["requestID"] scheduled in DC successfully!! | String |
POST /api/v2/dataCollector/bulk/schedule/
Description
Create a bulk network discovery request.
Header Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
| Authorization | Bearer API token/key. The format is Bearer <API_key> | String | Yes | |
| orgId | The ID of the organization. The format is OrgId:OrgName | String | Yes |
Body Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
| requestJson | Discovery details. The format is JSON | Object | Yes |
- At least one of the fields
ipPool.ipRangeоripPool.fqdnAddressmust be filled. Max 1024 IPs are allowed inipPool.ipRange. - At least one of the fields
communityStringInfoоrauthListmust be filled. - The
scheduleInfo.scheduleStartTime&scheduleInfo.scheduleEndTimefields are in EPOCH timestamp format in milliseconds & UTC. - The
scheduleInfo.intervalfield is in seconds. - The
communityStringInfofield is used for SNMP service accounts. - The
requestIdis mandatory for each element in the body and should be a unique value. Can use a UUID generator to generate a random request ID. - The
requestNamein each element in the body should be the same so that all elements would be considered part of the same bulk.
CURL Example
The below code snippet shows an example of creating bulk network discovery with an API call, where <NCE-IP>, <ORG-ID>, <SITE-ID>, <API-TOKEN> & <DISCOVERY-NAME> are variables.
curl --location 'https://<NCE-IP>/api/v2/dataCollector/bulk/schedule/' \
--header 'orgId: <ORG-ID>' \
--header 'siteId: <SITE-ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API-TOKEN>' \
--data '[
{
"ipPool": {
"ipRange": [{
"ipAddressFrom": "10.10.10.1",
"ipAddressTo": "10.10.10.20"
}
],
"maskRange": [],
"fqdnAddress": [],
"fqdnV6Address": []
},
"dsSelectedSiteId": "<SITE-ID>",
"dsSelectedOrganization": "<ORG-ID>",
"triggerType": "NETWORK_DISCOVERY",
"scheduleInfo": {
"interval": 960,
"scheduleStartTime": 1707838458000,
"scheduleEndTime": null
},
"communityStringInfo": [{
"serviceAccount": "QA-SNMP-v1"
}, {
"serviceAccount": "QA-SNMP-v2"
}
],
"authList": [{
"ssh": true,
"telnet": "",
"serviceAccount": "QA-SSH-1",
"windows": "",
"api": ""
}, {
"ssh": true,
"telnet": "",
"serviceAccount": "QA-SSH-2",
"windows": "",
"api": ""
}, {
"ssh": "",
"telnet": true,
"serviceAccount": "QA-TELNET-1",
"windows": "",
"api": ""
}, {
"ssh": "",
"telnet": "",
"serviceAccount": "QA-HYPERV-1",
"windows": true,
"api": ""
}, {
"ssh": "",
"telnet": "",
"apiType": "CITRIX",
"serviceAccount": "QA-PANORAMA-1",
"windows": "",
"api": true
}, {
"ssh": "",
"telnet": "",
"apiType": "PYSPHERE",
"serviceAccount": "QA-PANORAMA-2",
"windows": "",
"api": true
}, {
"ssh": "",
"telnet": "",
"apiType": "CISCO_MERAKI",
"serviceAccount": "QA-PANORAMA-3",
"windows": "",
"api": true
}
],
"enabledPasswordList": [],
"discoveredDeviceType": "true",
"applicationProperties": null,
"requestId": "17af07cb-b7eb-4bab-aa08-6c39ba4131d6",
"requestName": "<DISCOVERY-NAME>"
},
{
"ipPool": {
"ipRange": [{
"ipAddressFrom": "",
"ipAddressTo": ""
}
],
"maskRange": [],
"fqdnAddress": [{
"ip": "10.10.10.50",
"fqdn": ""
}
],
"fqdnV6Address": []
},
"dsSelectedSiteId": "<SITE-ID>",
"dsSelectedOrganization": "<ORG-ID>",
"triggerType": "NETWORK_DISCOVERY",
"scheduleInfo": {
"interval": 840,
"scheduleStartTime": 1707834858000,
"scheduleEndTime": 1708439658000
},
"communityStringInfo": [],
"authList": [{
"ssh": "",
"telnet": "",
"serviceAccount": "QA-WINDOWS-1",
"windows": true,
"api": ""
}, {
"ssh": "",
"telnet": "",
"apiType": "NETAPP",
"serviceAccount": "QA-NETAPP-1",
"windows": "",
"api": true
}
],
"enabledPasswordList": [],
"discoveredDeviceType": "true",
"applicationProperties": null,
"requestId": "a674c5e4-d0f5-46f5-9c18-9574571b57bd",
"requestName": "<DISCOVERY-NAME>"
}
]'
Response
Upon a successful request, the API returns Status code 200 with the following body:
| Name | Description | Type |
|---|---|---|
| data | "[DeviceNumber] Device(s) submitted successfully, It will take some time to schedule!" | String |